﻿#ifndef KONGMING_H
#define KONGMING_H
#include<QMainWindow>
#include <QWidget>
#include"mainwindow.h"
#include"GameModel.h"
#include"kongmingstart.h"

class kongming : public QMainWindow
{
    Q_OBJECT
public:
    explicit kongming(QWidget *parent = nullptr);
    kongmingstart * kongmingstartFace=nullptr;
        void getInitialP(int row,int col);
private:
    GameModel *game;//游戏指针
    //row=3 col=5  从上到下第四行 从左到右第六个
    int clickPosRow,clickPosCol;//存储将点击位置
    int pre_clickPosR,pre_clickPosC;//存储移动前的坐标
    int findleftX,findrightX,findaboveX,findunderX;//找到的四个下棋位置
    int findleftY,findrightY,findaboveY,findunderY;
    int clickPosR,clickPosC;//存储点击位置
    bool selectPos=false;//是否移动到合适的位置，以选中某个交叉点
    void paintEvent(QPaintEvent *event);
    void initGame2();
    void mouseMoveEvent(QMouseEvent *event);
    //void mouseReleaseEvent(QMouseEvent * event);
    void mousePressEvent(QMouseEvent* event);
    void chessOneByPerson();//预落子位置
    void chessOneByperson2();//移动棋子
    void getPreLocate();
    void chessOneByPerson3();

signals:

};

#endif // KONGMING_H
